home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: 26 Feb 1996
- // Author: ms
- //
- // Description:
- // This procedure is a callback for the drag/drop on deformers
-
- global proc dropDeformersReorder( string $dragged, string $drop, string $msgs[],
- int $x, int $y, int $type )
- {
- if( $dragged == $drop ) return;
- if( size($msgs) < 1 ) return;
- if( "deformersReorder" != $msgs[0] ) return;
-
- global string $gHistoryWindowNode;
-
- string $nameDragged = "";
- string $nameDropped = "";
- string $annDragged = "";
- string $annDropped = "";
- string $object = "";
- string $tmpobj = "";
- int $future = false;
- string $tmp[];
- int $n;
-
- if( "staticText" == `objectTypeUI $dragged` ) {
- $annDragged = `text -q -ann $dragged`;
- }
- if( "staticText" == `objectTypeUI $drop` ) {
- $annDropped = `text -q -ann $drop`;
- }
-
- if( ("" != $annDragged) && ("" != $annDropped) ) {
- tokenize( $annDropped, "|", $tmp );
- $n = size($tmp);
- if( $n > 2 ) {
- $object = $tmp[0];
- for( $i=1; $i<($n-2); $i+=1 ) {
- $object = $object + "|" + $tmp[$i];
- }
- if( "future" == $tmp[$n-2] ) {
- $future = true;
- }
- $nameDropped = $tmp[$n-1];
-
- tokenize( $annDragged, "|", $tmp );
- $n = size($tmp);
- if( $n > 2 ) {
- $tmpobj = $tmp[0];
- for( $i=1; $i<($n-2); $i+=1 ) {
- $tmpobj = $tmpobj + "|" + $tmp[$i];
- }
-
- $nameDragged = $tmp[$n-1];
-
- if( $tmpobj != $object ) {
- warning( "Mismatched deformer targets" );
- }
- }
- else {
- error( "bad name of the dragged item." );
- }
- }
- else {
- error( "bad name of the dropped item." );
- }
- }
-
- if( ("" != $nameDragged) && ("" != $nameDropped) ) {
- // Force the window to rebuild itself even though the selection
- // has not changed
- $gHistoryWindowNode = "";
-
- evalEcho( "reorderDeformers \"" + $nameDropped +
- "\" \"" + $nameDragged + "\" \"" + $object + "\"" );
- evalDeferred( "historyPopupFill \"" + $object + "\" " + $future + " 2");
- }
- }
-
-